<script src='http://cdn.bootcss.com/socket.io/1.3.7/socket.io.js'></script>
<script>
     var socket = new WebSocket("ws://o2o.p:2346");
     socket.onopen = function(event) {
            socket.send(
                []
            );
            // 发送一个初始化消息
            socket.send('1222');
 
        };
        socket.onmessage = function(event) {
            console.log('收到消息',event.data);
 
        };

   
</script>